<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="button" value="测试alert" onclick="testAlert()">
    <input type="button" value="测试confirm" onclick="testConfirm()">
    <input type="button" value="测试prompt" onclick="testPrompt()">

    <script>
        function testAlert() {
            alert("警告框");
        }

        function testConfirm() {
            if(confirm("确定退出吗？")){
                //确定操作
            }else{
                //取消操作
            }
        }

        function testPrompt(){
            //prompt("请输入购买的数量", 1)
            prompt("", "请输入购买的数量")
        }
    </script>
</body>
</html>